package com.yykj.order.center.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yykj.order.center.server.util.StringUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Builder
@Table(
        indexes = {
                @Index(columnList = "consultationId"),
                @Index(columnList = "doctorId"),
                @Index(columnList = "doctorHospitalId"),
                @Index(columnList = "status"),
        },
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"consultationId","doctorId"}),
        }
)
/**
 * 专家会诊订单 与会医生
 */
public class ConsultationDoctor {

    @Id
    @Column(length = 32)
    @TableId(type = IdType.INPUT)
    public String id;

    @Column(columnDefinition = "varchar(32) NOT NULL COMMENT '会诊Id'" ,nullable = false)
    public String consultationId;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '与会医生Id'", nullable = true)
    public String doctorId;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '与会医生名字'", nullable = true)
    public String doctorName;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '与会医生ImId'", nullable = true)
    public String doctorImId;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '与会医生所属医院Id'", nullable = true)
    public int doctorHospitalId;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '与会医生所属医院名字'", nullable = true)
    public String doctorHospitalName;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '与会医生所属部门Id'", nullable = true)
    public int doctorDepartmentId;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '与会医生所属部门名字'", nullable = true)
    public String doctorDepartmentName;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '联系电话'", nullable = true)
    private String mobile;

    @Column(columnDefinition = "varchar(200) DEFAULT '' COMMENT '职称'", nullable = true)
    private String officer;

    @Column(columnDefinition = "varchar(200) DEFAULT '' COMMENT '医生头像图片地址'", nullable = true)
    public String headImg;

    @Column(columnDefinition = "varchar(200) DEFAULT '' COMMENT '医生签名图片地址'", nullable = true)
    public String sign;

    @Column(columnDefinition = "varchar(2000) DEFAULT '' COMMENT '与会医生的会诊意见'", nullable = true)
    public String advise;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '会诊意见发表时间'", nullable = true)
    public int adviseAddtime;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '会诊意见修改时间'", nullable = true)
    public int adviseModifytime;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '与会状态,-1:被申请医师删除,0:新添加,1:无需审核可直接进入问诊,2:审核中,3:审核通过可进入问诊,4:审核失败,5:与会医师自己退出'", nullable = true)
    public int status;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '排序'", nullable = true)
    public int sort;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '若需要审核,审核失败原因'", nullable = true)
    public String reviewRemark;

    @Column(columnDefinition = "int(10) DEFAULT '0' COMMENT '审核时间'", nullable = true)
    public int reviewTime;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '删除原因'", nullable = true)
    public String removeRemark;

    @Column(columnDefinition = "int(10) DEFAULT '0' COMMENT '删除时间'", nullable = true)
    public int removeTime;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '自己退出原因'", nullable = true)
    public String quitRemark;

    @Column(columnDefinition = "int(10) DEFAULT '0' COMMENT '自己退出时间'", nullable = true)
    public int quitTime;

    @Column(columnDefinition = "int(10) DEFAULT '0' COMMENT '添加时间'", nullable = true)
    public int addtime = StringUtil.getCurrentTime();
}
